/*
 * @Author: your name
 * @Date: 2021-04-03 19:57:29
 * @LastEditTime: 2021-04-19 16:34:38
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \chronic-back-end\module\userMod\main.go
 */
package userMod

import (
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
)

/*Module 用户模块 */
func Module(app *gin.Engine) {
	module := app.Group("/user").Use(cors.Default())
	module.GET("/", Allow(), get)
	module.GET("/allDoctors", Allow(Patient, Admin), allDoctors)
	module.GET("/allPatients", Allow(Doctor, Admin), allPatients)
	module.GET("/allAdmins", Allow(Admin), allAdmins)
	module.GET("/users", Allow(), allUsers)
	module.PUT("/information", Allow(), putInformation)
	module.PUT("/admin/userInfo", Allow(Admin), adminPutUserInfo)
	module.DELETE("admin/user", Allow(Admin), adminDeleteUser)
	module.GET("userById", Allow(Admin), getUserById)
	module.GET("usersByCondition", Allow(Admin), getUsersByCondition)
	module.GET("patientsByDeal", Allow(Admin), getUsersByDeal)
	module.GET("dealDoctor", Allow(Patient), getDealDoctor)
}
